Skip to content

BUG: set value with iloc and list like indexer #37041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

BUG: set value with iloc and list like indexer #37041

wants to merge 4 commits into from

Conversation

erfannariman
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@erfannariman erfannariman marked this pull request as draft October 10, 2020 22:25
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what issue is this closing? this would need a test; i am not sure why you think this needs changing.

@erfannariman
Copy link
Member Author

what issue is this closing? this would need a test; i am not sure why you think this needs changing.

It's for #36741 , might not be the place to start, that's why its draft

@erfannariman
Copy link
Member Author

@jbrockmendel this seems to work, but when the dtype of the new values changes this will return the wrong dtype. For example (see example below), although the values will be correct. So it will solve the problem of the reference issue.

df_orig = DataFrame(
    [["1", "2", "3", ".4", 5, 6.0, "foo"]], columns=list("ABCDEFG")
)

df = df_orig.copy()
df.iloc[:, 0:2] = df.iloc[:, 0:2].astype(np.int64)
expected = DataFrame(
    [[1, 2, "3", ".4", 5, 6.0, "foo"]], columns=list("ABCDEFG")
)
tm.assert_frame_equal(df, expected)

Any ideas where I might look?

@simonjayhawkins
Copy link
Member

supersed by #37432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants